<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ page import="java.util.*"%>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="board.db.*" %>
<%
//System.out.println(request.getAttribute("listcount")+" "+request.getAttribute("page")+" "+request.getAttribute("maxpage")+" " +request.getAttribute("startpage")+" "+request.getAttribute("endpage"));

	List boardList=null;
	int listcount=1;
	int nowpage=1;
	int maxpage=1;
	int startpage=1;
	int endpage=1;
	
	if(request.getAttribute("listcount")==null)
	{
		response.sendRedirect("./manager_hot-girl.do");
	}
	else
	{
		boardList=(List)request.getAttribute("boardlist");
		listcount=((Integer)request.getAttribute("listcount")).intValue();
		nowpage=((Integer)request.getAttribute("page")).intValue();
		maxpage=((Integer)request.getAttribute("maxpage")).intValue();
		startpage=((Integer)request.getAttribute("startpage")).intValue();
		endpage=((Integer)request.getAttribute("endpage")).intValue();
%>


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>shopping your dream</title>

<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="default.css" rel="stylesheet" type="text/css" />
 
<script type="text/javascript">
<!--예제
	tabOver = function() {
		var submenu = document.getElementById('tabSubmenu').document
				.getElementsByTagName('li');
		for ( var i = 0; i < submenu.length; i++) {
			submenu[i].onmouseover = function() {
				this.className += ' over';
			}
			submenu[i].onmouseout = function() {
				this.className = this.className.replace(new RegExp(' over\\b'),
						'');
			}
		}
	}

	if (window.attachEvent)
		window.attachEvent('onload', tabOver);
	//스크립트 끝-->
</script>

</head>

<body>

<div id="logo-wrap">
<div id="logo">
<h1><a href="../harvest/index.jsp">Shop </a></h1>
<h2>Design your dream</h2>
</div>
</div>

<!-- start header -->
<div id="header">
<div id="menu">
  <ul id="tabSubmenu">
	<li><a href="#">SHOP</a>
	<ul>
		<li><a href="#">top</a></li>
		<li><a href="#">out</a></li>
		<li><a href="#">pants</a></li>
		<li><a href="#">skirt</a></li>
		<li><a href="#">dress</a></li>
		<li><a href="#">bag</a></li>
		<li><a href="#">etc</a></li>
	</ul>
	</li>
	<li><a href="#">TO OFFER</a>
	<ul>
		<li><a href="#">trend</a></li>
		<li><a href="#">style</a></li>
	</ul>
	</li>
	<li><a href="#">COMMUNITY</a>
	<ul>
		<li><a href="../board/qna_board_list.jsp">패션제안</a></li>
		<li><a href="../board/hot_girl_list.jsp">Hot girl</a></li>
	</ul>
	</li>
</ul>
<div class=""> 
<ul>
	<li><a href="#">Q & A</a></li>
	<li><a href="#">MYPAGE</a></li>
	<li><a href="#">CART</a></li>
	<li class="current_page_item"><a href="../login.jsp">
	<%
	String sessionId = (String)session.getAttribute("shop_id"); 
	if(sessionId == null)
	{
	%>
	LOG IN
	<%
	}
	else
	{
	%>
	<%=sessionId %> LOG OUT
	<%
	}
	%></a></li>
	<li class="last"><a href="../join.jsp">
	<% 
	if(sessionId == null)
	{
	%>
	JOIN US
	<%
	}
	else
	{
	%>
	<%
	}
	%>
	</a></li>
	<li><a href="../manager/manager_my.jsp">관리자홈</a></li>
</ul>
</div>
</div>
</div>
<!-- end header -->
<!-- 게시판 리스트 -->
<table width=50% border="0" cellpadding="0" cellspacing="0" align="center">
	<tr align="center" valign="middle">
			<font size=2>글 개수 : ${listcount }</font>
		</td>
	</tr>
	
	<tr align="center" valign="middle" bordercolor="#333333">
		<td style="font-family:Tahoma;font-size:8pt;" width="8%" height="26">
			<div align="center">번호</div>
		</td>
		
		<td style="font-family:Tahoma;font-size:8pt;" width="30%" height="40">
			<div align="center">이미지</div>
		</td>
		<td style="font-family:Tahoma;font-size:8pt;" width="50%">
			<div align="center">제목</div>
		</td>
		<td style="font-family:Tahoma;font-size:8pt;" width="14%">
			<div align="center">작성자</div>
		</td>
		<td style="font-family:Tahoma;font-size:8pt;" width="17%">
			<div align="center">날짜</div>
		</td>
		<td style="font-family:Tahoma;font-size:8pt;" width="11%">
			<div align="center">조회수</div>
		</td>
	</tr>
	
	<%
		for(int i=0;i<boardList.size();i++){
			BoardBean bl=(BoardBean)boardList.get(i);
	%>
	<tr align="center" valign="middle" bordercolor="#333333"
		onmouseover="this.style.backgroundColor='F8F8F8'"
		onmouseout="this.style.backgroundColor=''">
		<td height="23" style="font-family:Tahoma;font-size:10pt;">
			<%=bl.getBOARD_NUM()%>
		</td>
		
		<td style="font-family:Tahoma;font-size:10pt;">
			<div align="left">
			<%if(bl.getBOARD_RE_LEV()!=0){ %>
				<%for(int a=0;a<=bl.getBOARD_RE_LEV()*2;a++){ %>
				&nbsp;
				<%} %>
				▶
			<%}else{ %>
				▶
			<%} %>
			<a href="./manger_BoardDetailAction.do?num=<%=bl.getBOARD_NUM()%>">
				<%=bl.getBOARD_SUBJECT()%>
			</a>
			</div>
		</td>
		
		
		
		<td style="font-family:Tahoma;font-size:10pt;">
			<div align="center"><img src="C:\hb\ajaxworkspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\shopping mall\boardupload\<%=bl.getBOARD_FILE() %>"width="192" height="244" /></div>
		</td>
		<td style="font-family:Tahoma;font-size:10pt;">
			<div align="center"><%=bl.getBOARD_NAME() %></div>
		</td>
		<td style="font-family:Tahoma;font-size:10pt;">
			<div align="center"><%=bl.getBOARD_DATE() %></div>
		</td>	
		<td style="font-family:Tahoma;font-size:10pt;">
			<div align="center"><%=bl.getBOARD_READCOUNT() %></div>
		</td>
	</tr>
	<%} %>
	<tr align=center height=20>
		<td colspan=7 style=font-family:Tahoma;font-size:10pt;>
			<%if(nowpage<=1){ %>
			[이전]&nbsp;
			<%}else{ %>
			<a href="./BoardList.do?page=<%=nowpage-1 %>">[이전]</a>&nbsp;
			<%} %>
			
			<%for(int a=startpage;a<=endpage;a++){
				if(a==nowpage){%>
				[<%=a %>]
				<%}else{ %>
				<a href="./BoardList.do?page=<%=a %>">[<%=a %>]</a>&nbsp;
				<%} %>
			<%} %>
			
			<%if(nowpage>=maxpage){ %>
			[다음]
			<%}else{ %>
			<a href="./BoardList.do?page=<%=nowpage+1 %>">[다음]</a>
			<%} %>
		</td>
	</tr>
	<tr align="right">
		<td colspan="5">
	   		<a href="./BoardWrite.do">[글쓰기]</a>
		</td>
	</tr>
</table>
<%} %>
</body>
</html>